﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PersonaLibrary.ViewModel
{
	internal class UserControlViewModel : BaseViewModel
	{
		private RelayCommand _closeCommand;


		public RelayCommand CloseCommand
		{
			get
			{
				if(_closeCommand == null)
					_closeCommand = new RelayCommand(x => Close(), x => true);

				return _closeCommand;
			}
		}

		protected void Close()
		{
			CurrentApplication.RemoveViewModel(this);
			OnClose();
		}

		protected virtual void OnClose()
		{
			Dispose();
		}
	}
}
